package com.eaoa.uc.pubmessage.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.eaoa.base.EABaseAction;
import com.eaoa.uc.pubmessage.bo.MessageDeleteBO;

public class MessageDeleteAction extends EABaseAction {

	protected ActionForward doWork(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {

		String messageno = request.getParameter("messageno");
		String flag = request.getParameter("flag");

		MessageDeleteBO bo = new MessageDeleteBO(new Long(messageno));
		bo.execute();
		
		if(flag.equals("receive")){
			return mapping.findForward("success_receive");
		}else if(flag.equals("send")){
			return mapping.findForward("success_send");
		}

		return mapping.findForward("success");

	}
}
